﻿Module Module1
    '这是一个测试程序
    Sub Main()
        Dim redApple As Apple
        redApple = New Apple
        redApple.setColor("红色")
        redApple.printColor()
        Console.WriteLine("---------------------")
        Dim greenApple As Apple
        greenApple = New Apple
        greenApple.setColor("绿色")
        greenApple.printColor()
        Console.ReadKey()
    End Sub

End Module

Class Apple
    '苹果的价格
    Dim price As Integer
    Dim color As String

    Sub printPrice()
        Console.WriteLine("打印价格")
    End Sub
    Function printColor() As Boolean
        Console.WriteLine("打印颜色:" + Me.color)
        Return False
    End Function
    Sub setColor(c As String)
        Me.color = c
    End Sub

End Class
